<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Cache</title>
    
    <script runat="server">
        protected override HtmlTextWriter CreateHtmlTextWriter(System.IO.TextWriter tw)
        {
            return base.CreateHtmlTextWriter(Html.CreateCacheWriter(tw));
        }
    </script>
</head>
<body>
    <div>
        <%= DateTime.Now %>
        <br />
        
        <% Html.Cache("now", DateTime.Now.AddSeconds(5), () => { %>
        
            <%= DateTime.Now %>
            <br />
            
            <% Html.Cache("inner_now", DateTime.Now.AddSeconds(10), () => { %>
            
                <% Html.RenderPartial("CurrentTime"); %>
            
            <% }); %>
            
        <% }); %>
    </div>
</body>
</html>
